<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>添加产品分类</title>
    <link href="__STATIC__/admin/assets/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="__STATIC__/admin/css/style.css" />
    <link rel="stylesheet" href="__STATIC__/admin/assets/css/ace.min.css" />
    <link rel="stylesheet" href="__STATIC__/admin/assets/css/font-awesome.min.css" />
    <link href="__STATIC__/admin/Widget/icheck/icheck.css" rel="stylesheet" type="text/css" />
    <!--[if IE 7]>
    <link rel="stylesheet" href="__STATIC__/admin/assets/css/font-awesome-ie7.min.css" />
    <![endif]-->
    <!--[if lte IE 8]>
    <link rel="stylesheet" href="__STATIC__/admin/assets/css/ace-ie.min.css" />
    <![endif]-->
    <script src="__STATIC__/admin/js/jquery-1.9.1.min.js"></script>
    <script src="__STATIC__/admin/assets/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="__STATIC__/admin/bootstrap-fileinput-master/css/fileinput.css"/>
    <script src="__STATIC__/admin/bootstrap-fileinput-master/js/fileinput.js"></script>
    <script src="__STATIC__/admin/bootstrap-fileinput-master/js/locales/zh.js"></script>
    <link rel="stylesheet" type="text/css" href="__STATIC__/admin/summernote/summernote.css">
    <script src="__STATIC__/admin/summernote/summernote.js"></script>
    <link rel="stylesheet" href="__STATIC__/index/css/base.css">
    <link rel="stylesheet" href="__STATIC__/index/css/style.css">

</head>

<body>
<div class="head-box">
    <div class="head wrap">
        <div class="logo fl"><a href=""><img src="__STATIC__/index/images/logo.png"></a></div>
        <div class="head-right fr">
            <div class="head-a fr">
                {if condition='$user'}
                <div class="head-a1 fl"><a href=""><img src="__STATIC__/index/images/tb-a.png"></a></div>
                <div class="head-a1 fl"><a href=""><img src="__STATIC__/index/images/tb-b.png"></a></div>
                <div class="tbt fl"><img src="__UPLOAD__/user/{$user.image_thumb}" style="width: 30px;">
                    <div class="hgt-btm">
                        <a href="{:url('user/collection',['user_id'=>$user.user_id])}">我的主页</a>
                        <a href="">消息</a>
                        <a href="">我的关注</a>
                        <a href="{:url('user/account',['user_id'=>$user.user_id])}">帐号设置</a>
                        <a href="{:url('user/logon')}">退出</a>
                    </div>
                </div>

                {else}
                <div class="head-a1 fl"><a href=""><img src="__STATIC__/index/images/tb-a.png"></a></div>
                <div class="head-a1 fl"><a href=""><img src="__STATIC__/index/images/tb-b.png"></a></div>
                <div class="head-a3 fl"><a href="{:url('login/index')}">登录</a></div>
                <div class="head-a4 fl"><a href="{:url('login/login')}">注册</a></div>
                {/if}


            </div>
            <div class="clearfix"></div>
            <div class="nav fr">
                <ul>
                    <li><a href="{:url('index/index')}">首页</a></li>
                    <li class="nav-cut"><a href="{:url('question/article')}">文章</a>
                    </li>
                </ul>
            </div>
            <div class="clearfix"></div>
        </div>
    </div>
</div>
<div class="content">
    <div class="wrap">
        <div class="tsm-height"></div>
        <form action="(:url('question/add'))" method="post">
        <div class="tsm-a" style="display:block;">
            <input type="hidden" name="user_id" value="{$user_id}">
            <div class="tsm-a1" style="height: 100px;">
                <label class="form-label" >文章标题:</label>
                <div class="tsm-a3"><input type="text" name="q_title" class="tsm-text1" id="user_name"
                                           value="" style="width: 500px;height: 40px;"/></div>
            </div>
            <div  class="Operate_cont">
                <label class="form-label" >上传图片:</label>
                <input id="imgUpload" type="file" class="file-loading">
                <input type="hidden" name="image" id="image" value="">
                <input type="hidden" name="image_thumb" id="image_thumb" value="">
            </div>
            <div class="Operate_cont clearfix">
                <label class="form-label" >文章内容:</label>
                <div class="formControls ">
                    <textarea id="content" name="q_desc"></textarea>
                    <span class="Validform_checktip"></span>
                </div>
            </div>
            <div id="xg-btn" style="margin-top: -200px;margin-left: 900px"><input type="submit" class="tsm-btn" value="提交"></div>


            </div>
        </form>
        </div>
    </div>


<script type="text/javascript" src="__STATIC__/admin/Widget/Validform/5.3.2/Validform.min.js"></script>
<script src="__STATIC__/index/js/Action.js"></script>
<script type="text/javascript">
    $(function() {
        //表单验证
        $("form").Validform({
            tiptype:function(msg,o,cssctl){
                if(!o.obj.is("form")){
                    //默认表单
                    var objtip=o.obj.parents(".formControls").find(".Validform_checktip");
                    cssctl(objtip,o.type);
                    objtip.text(msg);
                }
            },
            showAllError:true
        })
    });
    $('#imgUpload').fileinput({
        language:'zh',
        uploadUrl:'{:url("question/uploadImg")}',
        autoRelace:true,
        maxFileCount:1,
        allowedFileExtensions:["jpg","png","gif"],
        browseClass:"btn btn-primary",
        previeFileIcon:"<i class='glyphicon glyphicon-king'></i>"
    });
    $('#imgUpload').on('fileuploaded',function (e,data) {
        if(data.response.status>0){
            $('#image').val(data.response.path);
            $('#image_thumb').val(data.response.thumb);
        }else{
            alert(data.response.err);
        }
    });
    $(document).ready(function () {
        $('#content').summernote();
    });
</script>
</body>
</html>